package com.zhixi.pattern.important.prototypepattern.prototypepattern;

import com.zhixi.pattern.important.prototypepattern.prototypepattern.operation.Sheep;

/**
 * 原型模式
 *
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/15 14:00
 */
public class PrototypePattern {

    public static void main(String[] args) throws CloneNotSupportedException {
        Sheep sheep = new Sheep("tom", 1, "白色");
        Sheep sheep1 = sheep.clone();
        System.out.println(sheep.hashCode());
        System.out.println(sheep1.hashCode());
        System.out.println(sheep);
        System.out.println(sheep1);
    }

}
